export default {
  testEnvironment: 'jsdom',
  transform: {
    '^.+\\.vue$': '@vue/vue3-jest',
    '^.+\\.js$': 'babel-jest'
  },
  moduleFileExtensions: ['js', 'vue'],
  testMatch: ['**/tests/frontend/unit/**/*.test.js'],
  collectCoverage: true,
  collectCoverageFrom: [
    'src/**/*.{js,vue}',
    '!src/main.js',
    '!**/node_modules/**'
  ],
  coverageDirectory: 'coverage',
  moduleNameMapper: {
    '^@/(.*)$': '<rootDir>/src/$1'
  },
  // 模拟浏览器API
  setupFiles: ['./tests/frontend/setup.js'],
  transformIgnorePatterns: [
    'node_modules/(?!(axios|vue|chart.js)/)'
  ]
};